//
//  JKSpecialColumnCell.swift
//  ZhiHuDaily-Swift
//
//  Created by albert on 2018/3/14.
//  Copyright © 2018年 安永博. All rights reserved.
//

import UIKit

class JKSpecialColumnCell: JKBaseTableViewCell {

    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var subLabel: UILabel!
    @IBOutlet weak var rightImageView: UIImageView!
    @IBOutlet weak var imageCoverView: UIView!
    
    @IBOutlet weak var sepView: UIView!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
        titleLabel.font = JKCellTitleFont
    }
    
    override func initialization() {
        super.initialization()
        
    }
    
    /** 栏目模型 */
    public var model: JKNewsDetailSectionModel? {
        
        didSet{
            
            self.titleLabel.text = model?.name
            self.subLabel.text = model?.description
            
            self.rightImageView.jk_setImage(withUrlStr: model?.thumbnail, placeHolder: "Image_Preview")
        }
    }
    
    override func setHighlighted(_ highlighted: Bool, animated: Bool) {
        super.setHighlighted(highlighted, animated: animated)
        
        imageCoverView.backgroundColor = UIColor.black.withAlphaComponent(0.5)
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}

extension JKSpecialColumnCell {
    
    override func updateSkin() {
        super.updateSkin()
        
        self.titleLabel.textColor = (skinModel == JKNightSkinModelValue) ? JKColor(186, 186, 186) : JKColor(53, 53, 53)
        self.subLabel.textColor = (skinModel == JKNightSkinModelValue) ? JKSameRGBColor(108) : JKSameRGBColor(118)
        
        self.sepView.backgroundColor = (skinModel == JKNightSkinModelValue) ? JKSameRGBColor(66) : JKSameRGBColor(217)
        
        self.imageCoverView.isHidden = (skinModel == JKDaySkinModelValue) || rightImageView.isHidden
    }
}
